'use strict';
let Response = require('../../../model/Response');
let RestifyProxy = require('../../../util/RestifyProxy');
let CustomPageBean = require('../../../model/CustomPageBean');
let singleLightConditionService = require('../../../service/Report/singleLightConditionService');
let logger = require('../../../util/LoggerUtil').logger('singleLightConditionController.js');

/**
 * 单灯工况页面
 */

module.exports.singleLightConditionPage = function () {
  let response = new Response();
  response.render('back/report/singleLight-condition/singleLight-condition');
  this.resolve(response);
};
/**
 * 单灯工况列表
 */
module.exports.singleLightConditionList = async function () {
  let req = this.req;
  let params = req.body;
  let response = new Response();
  try {
    let result = await singleLightConditionService.singleLightConditionList(this, params);
    let pageBean = new CustomPageBean(result);
    response.send(pageBean);
  } catch (error) {
    logger.error(error);
  }
  this.resolve(response);
};

/**
 * 报文日志Excel导出
 */
module.exports.singleLightConditionExport = async function () {
  let req = this.req;
  let params = req.body;
  let response = new Response();
  try {
    let result = await singleLightConditionService.getSingleLightConditionExport(this, params);
    response.send(result);
  } catch (error) {
    logger.error(error);
  }
  this.resolve(response);
};

